//
//  AdverInforModel.swift
//  Exchange
//
//  Created by 孟祥群 on 2018/6/21.
//  Copyright © 2018年 common. All rights reserved.
//

import UIKit
import ObjectMapper
class AdverInforModel: BaseModel, Mappable {
    var address : String = ""
    var createdAt : String = ""
    var currency : String = ""
    var dealCount : Int?
    var highOpinionRatio : String = ""
    var historyDealAmount : Int?
    var id : Int?
    var isBlack : Int?
    var isTrust : Int?
    var limitLowerMoney : Double = 0.00
    var limitUpperMoney : Double = 0.00
    var lowestPrice : Double = 0.00
    var message : String = ""
    var moneyType : String = ""
    var needVerify : Int?
    var number : String?
    var occupied : Int?
    var openTime : Int?
    var openTimeList : [OpenTimeList]?
    var paymentMethod : Int?
    var portrait : String?
    var premium : Int?
    var price : Double = 0.00
    var status : Int?
    var trustNum : Int?
    var trustTrade : Int?
    var type : Int?
    var updatedAt : String?
    var userId : Int?
    var userName : String?
    var userPhone : String?
    
    required init?(map: Map){}
    private override init(){}
    
    func mapping(map: Map)
    {
        address <- map["address"]
        createdAt <- map["createdAt"]
        currency <- map["currency"]
        dealCount <- map["dealCount"]
        highOpinionRatio <- map["highOpinionRatio"]
        historyDealAmount <- map["historyDealAmount"]
        id <- map["id"]
        isBlack <- map["isBlack"]
        isTrust <- map["isTrust"]
        limitLowerMoney <- map["limitLowerMoney"]
        limitUpperMoney <- map["limitUpperMoney"]
        lowestPrice <- map["lowestPrice"]
        message <- map["message"]
        moneyType <- map["moneyType"]
        needVerify <- map["needVerify"]
        number <- map["number"]
        occupied <- map["occupied"]
        openTime <- map["openTime"]
        openTimeList <- map["openTimeList"]
        paymentMethod <- map["paymentMethod"]
        portrait <- map["portrait"]
        premium <- map["premium"]
        price <- map["price"]
        status <- map["status"]
        trustNum <- map["trustNum"]
        trustTrade <- map["trustTrade"]
        type <- map["type"]
        updatedAt <- map["updatedAt"]
        userId <- map["userId"]
        userName <- map["userName"]
        userPhone <- map["userPhone"]
        
    }
}
class OpenTimeList: BaseModel, Mappable {
    var advId : Int?
    var closeTime : String = "00:00"
    var id : Int?
    var loopDate : String = ""
    var openTime : String = "00:00"
    var status : Int?
    var userId : Int?
    
    
    class func newInstance(map: Map) -> Mappable?{
        return OpenTimeList()
    }
    required init?(map: Map){}
    private override init(){}
    
    func mapping(map: Map)
    {
        advId <- map["advId"]
        closeTime <- map["closeTime"]
        id <- map["id"]
        loopDate <- map["loopDate"]
        openTime <- map["openTime"]
        status <- map["status"]
        userId <- map["userId"]
        
    }
}
